import sys
t,p,l,s = [0],0,0,''.join([c for c in sys.stdin])
sys.stdin=open("/dev/tty")
while l<len(s):
	c=s[l]
	if c=='+':t[p]+=1
	elif c=='-':t[p]=t[p] and t[p]-1
	elif c=='>':
		p+=1
		if p==len(t):t.append(0)
	elif c=='<':p=p and p-1
	elif c=='.':sys.stdout.write(chr(t[p]))
	elif c==',':t[p]=ord(sys.stdin.read(1)) or t[p]
	elif c in '[]':
		b,q=1,92-ord(c)
		if (q>0)^(t[p]>0):
			while b!=0:
				l+=q
				c=s[l]
				b+=c in '[]' and q*(92-ord(c)) or 0
	l+=1
print